//
//  LoginManager.m
//  JPWords
//
//  Created by 梁淑婷 on 2024/6/11.
//

#import "LoginManager.h"

@implementation LoginManager

- (NSString *)methodName{
    return @"/login";
}

- (JPAPIManagerRequestType)requestType{
    return JPAPIManagerRequestTypePOST;
}

#pragma mark - JPAPIManagerParamSource
- (NSDictionary *)paramsForApi:(JPAPIBaseManager *)manager{
    NSMutableDictionary *dict = @{}.mutableCopy;
    dict[@"loginMode"] = self.loginMode;
    if([self.loginMode isEqualToString:@"1"]){
        dict[@"username"] = self.username;
        dict[@"password"] = self.password;
    }else if ([self.loginMode isEqualToString:@"2"]){
        dict[@"phone"] = self.phone;
        dict[@"mobileCode"] = self.mobileCode;
    }else if ([self.loginMode isEqualToString:@"3"]){
        dict[@"wxCode"] = self.wxCode;
    }
    return dict;
}

@end
